package com.just.springboot.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/test")
@Api(value = "测试",description = "测试controller说明",tags = "测试tags")
public class TestController {
    @ApiOperation(value = "测试get")
    @RequestMapping(value = "/getTest1",method = RequestMethod.GET)
    public String test1(@RequestParam String name,@RequestParam String phone){
        return "hello:"+name+".your phone is"+phone;
    }
    @ApiOperation(value = "测试post")
    @RequestMapping(value = "postTest1",method = RequestMethod.POST)
    public Object test2(@RequestBody BootUser bootUser){
        return bootUser;
    }
    private static class BootUser{
        private String name;
        private Integer age;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getAge() {
            return age;
        }

        public void setAge(Integer age) {
            this.age = age;
        }
    }
}
